import Mock from 'mockjs'
// 2.自行模拟数据，开发相关接口
const data = Mock.mock({
  "commodityList|10-30": [{
    "title": '@ctitle',
    "url": '@image(50x50, @color)',
    "banners|4-6": ["@image(100x100, @color)"],
    "desc": '@word(10,20)',
    "price|10-100": 1,
    "id": '@id',
    "isCollect":  false,
    "discount": [{
      title: '优惠卷',
      content: '满100减少10块'
    },{
      title: '优惠卷',
      content: '满200减少50块'
    },{
      title: '优惠卷',
      content: '满500减少200块'
    }]
  }]
})

// 2.自行模拟数据，开发相关接口
Mock.mock('/api/list',() => {
  return {
    code: 200,
    data: data.commodityList
  }
})

